package syncmellariusnote;



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


import com.dao.access.HibernateUtil;
import java.io.IOException;
import java.sql.SQLException;
import syncmellariusnote.helpers.ConnectorConfigurator;


/**
 *
 * @author Vitor
 */
public class SyncMellariusNot {

    /**
     * @param args the command line arguments
     * @throws javax.comm.PortInUseException
     * @throws javax.comm.UnsupportedCommOperationException
     * @throws java.io.IOException
     * @throws javax.comm.NoSuchPortException
     * @throws java.lang.InterruptedException
     */
    public static String  accessDataBasePath;// = "jdbc:ucanaccess://C:/MD/dados_apis.mdb;showschema=true";
    public static String  accessDataBase;
    public static String  adbPort;
    public static String  ip;
    public static boolean connectionTypeWifi = false;
    
    public static void main( String args[]) throws SQLException, ClassNotFoundException, IOException{
          accessDataBasePath = "jdbc:ucanaccess://"+args[0]+";showschema=true";
          accessDataBase = args[0];
          adbPort = args[1];
          ip = args[2];
          if(args[3].equals("0")){
            connectionTypeWifi= false;
          }else{
            connectionTypeWifi= true;
          }
          ConnectorConfigurator conn = new ConnectorConfigurator();
          conn.initializeConnection();
          HibernateUtil.getSessionFactory();
 
          if(!connectionTypeWifi){
            conn.execAdb();    
          }
          
          
          InterfaceConnector iConn = new InterfaceConnector();



    }
    public static String  getUrl(){
    return accessDataBasePath;
    }
    public static boolean  getConnectionType(){
    return connectionTypeWifi;
    }
    public static String  getPath(){
        //return accessDataBasePath;
    return accessDataBase;
    }
    public static int  getPort(){
    return Integer.valueOf(adbPort);
    }
}
